<?php

namespace App\Http\Controllers\admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class MenuController extends Controller
{
    // 获取菜单列表
    public function menus(){

         $arr = [

             [
             "id"=>101,
             "name"=>"用户管理",
             "path"=>"/users",
             "children"=>[
                    [
                        "id"=>105,
                        "name"=>"用户列表",
                        "path"=>"users",
                        "children"=>[]
                    ],
                    [
                        "id"=>106,
                        "name"=>"创建用户",
                        "path"=>"add_user",
                        "children"=>[]
                    ],
                ]
            ],
            [
             "id"=>108,
             "name"=>"房源管理",
             "path"=>"/houses",
             "children"=>[
                    [
                        "id"=>109,
                        "name"=>"房源列表",
                        "path"=>"houses",
                        "children"=>[]
                    ],
                    [
                        "id"=>110,
                        "name"=>"创建房源",
                        "path"=>"add_house",
                        "children"=>[]
                    ],
                ]
            ],
            [
                "id"=>112,
                "name"=>"消息管理",
                "path"=>"/houses",
                "children"=>[
                       [
                           "id"=>113,
                           "name"=>"消息列表",
                           "path"=>"msg_list",
                           "children"=>[]
                       ],
                       [
                           "id"=>115,
                           "name"=>"创建消息",
                           "path"=>"add_msg",
                           "children"=>[]
                       ],
                   ]
               ],
               [
                "id"=>120,
                "name"=>"个人中心",
                "path"=>"/houses",
                "children"=>[
                       [
                           "id"=>121,
                           "name"=>"密码设置",
                           "path"=>"reset_password",
                           "children"=>[]
                       ],
                       [
                           "id"=>122,
                           "name"=>"头像设置",
                           "path"=>"set_usericon",
                           "children"=>[]
                       ],
                   ]
               ],

        ];

        $data = json_decode(json_encode($arr),false);
        return response()->json(['meta'=>['msg'=>'请求成功','status'=>200],'data'=>$data]);

      }
}
